package Chapter02.HomeWork;

import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        System.out.println("请输入一个五位数：");
        Scanner input= new Scanner(System.in);
        int ge=0,shi=0,bai=0,qian=0,wan=0,sum=0;
        int num=input.nextInt();
        ge=num%10;
        shi=num/10%10;
        bai=num/100%10;
        qian=num/1000%10;
        wan=num/10000;
        sum=ge+shi+bai+qian+wan;
        System.out.println("各位之和为："+sum);
    }
}
